<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/views1/DTD/views1-transitional.dtd">
<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">
	<ui:composition template="/views/layout/main.xhtml">
		<ui:define name="conteudo">
			<h:form id="formPrincipal">
				<div class="grid_18 div_48">
					<p:commandButton widgetVar="btn_Novo" styleClass="add-notes" ajax="false" immediate="true"
						action="#{provaBean.goCreate}" title="Novo"/>
					<p:commandButton widgetVar="btn_Buscar" styleClass="search-notes" type="button" 
						title="Buscar" onclick="promptBuscaProva.show();" />
					<p:commandButton styleClass="home" ajax="false" immediate="true" 
						action="#{provaBean.goHome}" title="Início" />
				</div>

				<div class="grid_18 titulo">Visualizar Prova</div>

				<div class="grid_18">
					<p:messages id="messages"/>
				</div>

				<div class="grid_3 div-label">Código</div>
				<div class="grid_6 div-campo">
					<p:inputText value="#{provaBean.provaInstance.codigo}" disabled="true" styleClass="width_5" />
				</div>
				
				<div class="grid_2 div-label">Professor</div>
				<div class="grid_7 div-campo">
					<p:inputText value="#{provaBean.provaInstance.professor.nomeCompleto}" disabled="true" styleClass="width_7" />
				</div>
				
				<div class="grid_3 div-label">Aplicada Em</div>
				<div class="grid_6 div-campo">
					<p:inputText value="#{provaBean.provaInstance.aplicadaEm.ano}" disabled="true" styleClass="width_5">
						<f:convertDateTime pattern="yyyy" />
					</p:inputText>
				</div>
				
				<div class="grid_2 div-label">Valor</div>
				<div class="grid_3 div-campo">
					<p:inputText value="#{provaBean.provaInstance.valor}" disabled="true" styleClass="width_2" />
				</div>
				<div class="grid_2 div-label">Peso</div>
				<div class="grid_2 div-campo">
					<p:inputText value="#{provaBean.provaInstance.peso}" disabled="true" styleClass="width_2" />
				</div>
				
				<div class="grid_3 div-label">Descrição</div>
				<div class="grid_15 div-label">
					<p:inputTextarea value="#{provaBean.provaInstance.peso}" disabled="true" autoResize="false" rows="4" 
					styleClass="width_15" />
				</div>
				
				<div class="grid_18 subtitulo">Questões</div>
				
				<div class="grid_18">
					<p:dataTable widgetVar="dataTableQuestoes" 
						id="dataTableQuestoes" 
						paginator="true" paginatorPosition="bottom"
						value="#{provaBean.provaInstance.questoes}" var="var"
						emptyMessage="Nenhum registro encontrado!" 
						rows="10" dynamic="true">
					<p:column headerText="Código">
			            <h:outputText value="#{var.codigo}" />  
			        </p:column>
			        <p:column headerText="Cabeçalho">
			        	<h:outputText value="#{var.cabecalho}" />
			        </p:column> 
				</p:dataTable>
				</div>
			</h:form>
			
			<ui:include src="/views/prova/_promptBuscaProva.xhtml" />
			
			<script type="text/javascript" src="#{request.contextPath}/resources/js/prova.js" />
		</ui:define>
	</ui:composition>
</f:view>